 /* Copyright 2018 JDCLOUD.COM

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http:#www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.





Contact: 

NOTE: This class is auto generated by the jdcloud code generator program.
*/


#import <Foundation/Foundation.h>
#import <JDCloudOCSDKVm/VmModel.h>

@implementation SecurityGroupSimple
-(id) initWithGroupId:(NSString*) groupId
      groupName:(NSString*)groupName { 
     self.groupId = groupId;               
     self.groupName = groupName;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self groupId])
    {
        [result setValue:[self groupId] forKey:@"groupId"];
    }
    if([self groupName])
    {
        [result setValue:[self groupName] forKey:@"groupName"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.groupId = [dictionary objectForKey:@"groupId"];
    self.groupName = [dictionary objectForKey:@"groupName"];
    return self;
}
 @end
@implementation InstanceTemplateElasticIpSpec
-(id) initWithBandwidthMbps:(NSNumber*) bandwidthMbps
      provider:(NSString*)provider
      chargeMode:(NSString*)chargeMode { 
     self.bandwidthMbps = bandwidthMbps;               
     self.provider = provider;               
     self.chargeMode = chargeMode;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self bandwidthMbps])
    {
        [result setValue:[self bandwidthMbps] forKey:@"bandwidthMbps"];
    }
    if([self provider])
    {
        [result setValue:[self provider] forKey:@"provider"];
    }
    if([self chargeMode])
    {
        [result setValue:[self chargeMode] forKey:@"chargeMode"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.bandwidthMbps = [dictionary objectForKey:@"bandwidthMbps"];
    self.provider = [dictionary objectForKey:@"provider"];
    self.chargeMode = [dictionary objectForKey:@"chargeMode"];
    return self;
}
 @end
@implementation InstanceTemplateDisk
-(id) initWithDiskType:(NSString*) diskType
      diskSizeGB:(NSNumber*)diskSizeGB
      snapshotId:(NSString*)snapshotId { 
     self.diskType = diskType;               
     self.diskSizeGB = diskSizeGB;               
     self.snapshotId = snapshotId;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self diskType])
    {
        [result setValue:[self diskType] forKey:@"diskType"];
    }
    if([self diskSizeGB])
    {
        [result setValue:[self diskSizeGB] forKey:@"diskSizeGB"];
    }
    if([self snapshotId])
    {
        [result setValue:[self snapshotId] forKey:@"snapshotId"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.diskType = [dictionary objectForKey:@"diskType"];
    self.diskSizeGB = [dictionary objectForKey:@"diskSizeGB"];
    self.snapshotId = [dictionary objectForKey:@"snapshotId"];
    return self;
}
 @end
@implementation InstanceTemplateNetworkInterface
-(id) initWithSubnetId:(NSString*) subnetId
      securityGroups:(NSArray<NSString*>*)securityGroups
      sanityCheck:(NSNumber*)sanityCheck { 
     self.subnetId = subnetId;               
     self.securityGroups = securityGroups;               
     self.sanityCheck = sanityCheck;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self subnetId])
    {
        [result setValue:[self subnetId] forKey:@"subnetId"];
    }
    if([self securityGroups])
    {
        [result setValue:[self securityGroups] forKey:@"securityGroups"];
    }
    if([self sanityCheck])
    {
        [result setValue:[self sanityCheck] forKey:@"sanityCheck"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.subnetId = [dictionary objectForKey:@"subnetId"];
    self.securityGroups = [dictionary objectForKey:@"securityGroups"];
    self.sanityCheck = [dictionary objectForKey:@"sanityCheck"];
    return self;
}
 @end
@implementation InstanceTemplateElasticIp
-(id) initWithBandwidthMbps:(NSNumber*) bandwidthMbps
      provider:(NSString*)provider
      chargeMode:(NSString*)chargeMode { 
     self.bandwidthMbps = bandwidthMbps;               
     self.provider = provider;               
     self.chargeMode = chargeMode;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self bandwidthMbps])
    {
        [result setValue:[self bandwidthMbps] forKey:@"bandwidthMbps"];
    }
    if([self provider])
    {
        [result setValue:[self provider] forKey:@"provider"];
    }
    if([self chargeMode])
    {
        [result setValue:[self chargeMode] forKey:@"chargeMode"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.bandwidthMbps = [dictionary objectForKey:@"bandwidthMbps"];
    self.provider = [dictionary objectForKey:@"provider"];
    self.chargeMode = [dictionary objectForKey:@"chargeMode"];
    return self;
}
 @end
@implementation Ag
-(id) initWithName:(NSString*) name
      idValue:(NSString*)idValue { 
     self.name = name;               
     self.idValue = idValue;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self name])
    {
        [result setValue:[self name] forKey:@"name"];
    }
    if([self idValue])
    {
        [result setValue:[self idValue] forKey:@"id"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.name = [dictionary objectForKey:@"name"];
    self.idValue = [dictionary objectForKey:@"id"];
    return self;
}
 @end
@implementation VmQuota
-(id) initWithResourceType:(NSString*) resourceType
      limit:(NSNumber*)limit
      used:(NSNumber*)used { 
     self.resourceType = resourceType;               
     self.limit = limit;               
     self.used = used;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self resourceType])
    {
        [result setValue:[self resourceType] forKey:@"resourceType"];
    }
    if([self limit])
    {
        [result setValue:[self limit] forKey:@"limit"];
    }
    if([self used])
    {
        [result setValue:[self used] forKey:@"used"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.resourceType = [dictionary objectForKey:@"resourceType"];
    self.limit = [dictionary objectForKey:@"limit"];
    self.used = [dictionary objectForKey:@"used"];
    return self;
}
 @end
@implementation LocalDisk
-(id) initWithDiskType:(NSString*) diskType
      diskSizeGB:(NSNumber*)diskSizeGB { 
     self.diskType = diskType;               
     self.diskSizeGB = diskSizeGB;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self diskType])
    {
        [result setValue:[self diskType] forKey:@"diskType"];
    }
    if([self diskSizeGB])
    {
        [result setValue:[self diskSizeGB] forKey:@"diskSizeGB"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.diskType = [dictionary objectForKey:@"diskType"];
    self.diskSizeGB = [dictionary objectForKey:@"diskSizeGB"];
    return self;
}
 @end
@implementation Gpu
-(id) initWithModel:(NSString*) model
      number:(NSNumber*)number { 
     self.model = model;               
     self.number = number;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self model])
    {
        [result setValue:[self model] forKey:@"model"];
    }
    if([self number])
    {
        [result setValue:[self number] forKey:@"number"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.model = [dictionary objectForKey:@"model"];
    self.number = [dictionary objectForKey:@"number"];
    return self;
}
 @end
@implementation InstanceTypeState
-(id) initWithAz:(NSString*) az
      inStock:(NSNumber*)inStock { 
     self.az = az;               
     self.inStock = inStock;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self az])
    {
        [result setValue:[self az] forKey:@"az"];
    }
    if([self inStock])
    {
        [result setValue:[self inStock] forKey:@"inStock"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.az = [dictionary objectForKey:@"az"];
    self.inStock = [dictionary objectForKey:@"inStock"];
    return self;
}
 @end
@implementation InstanceTemplateDiskSpec
-(id) initWithDiskType:(NSString*) diskType
      diskSizeGB:(NSNumber*)diskSizeGB
      snapshotId:(NSString*)snapshotId { 
     self.diskType = diskType;               
     self.diskSizeGB = diskSizeGB;               
     self.snapshotId = snapshotId;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self diskType])
    {
        [result setValue:[self diskType] forKey:@"diskType"];
    }
    if([self diskSizeGB])
    {
        [result setValue:[self diskSizeGB] forKey:@"diskSizeGB"];
    }
    if([self snapshotId])
    {
        [result setValue:[self snapshotId] forKey:@"snapshotId"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.diskType = [dictionary objectForKey:@"diskType"];
    self.diskSizeGB = [dictionary objectForKey:@"diskSizeGB"];
    self.snapshotId = [dictionary objectForKey:@"snapshotId"];
    return self;
}
 @end
@implementation VmTagFilter
-(id) initWithKey:(NSString*) key
      values:(NSArray<NSString*>*)values { 
     self.key = key;               
     self.values = values;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self key])
    {
        [result setValue:[self key] forKey:@"key"];
    }
    if([self values])
    {
        [result setValue:[self values] forKey:@"values"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.key = [dictionary objectForKey:@"key"];
    self.values = [dictionary objectForKey:@"values"];
    return self;
}
 @end
@implementation InstanceTemplateNetworkInterfaceSpec
-(id) initWithSubnetId:(NSString*) subnetId
      securityGroups:(NSArray<NSString*>*)securityGroups
      sanityCheck:(NSNumber*)sanityCheck { 
     self.subnetId = subnetId;               
     self.securityGroups = securityGroups;               
     self.sanityCheck = sanityCheck;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self subnetId])
    {
        [result setValue:[self subnetId] forKey:@"subnetId"];
    }
    if([self securityGroups])
    {
        [result setValue:[self securityGroups] forKey:@"securityGroups"];
    }
    if([self sanityCheck])
    {
        [result setValue:[self sanityCheck] forKey:@"sanityCheck"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.subnetId = [dictionary objectForKey:@"subnetId"];
    self.securityGroups = [dictionary objectForKey:@"securityGroups"];
    self.sanityCheck = [dictionary objectForKey:@"sanityCheck"];
    return self;
}
 @end
@implementation Keypair
-(id) initWithKeyName:(NSString*) keyName
      keyFingerprint:(NSString*)keyFingerprint
      createTime:(NSString*)createTime { 
     self.keyName = keyName;               
     self.keyFingerprint = keyFingerprint;               
     self.createTime = createTime;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self keyName])
    {
        [result setValue:[self keyName] forKey:@"keyName"];
    }
    if([self keyFingerprint])
    {
        [result setValue:[self keyFingerprint] forKey:@"keyFingerprint"];
    }
    if([self createTime])
    {
        [result setValue:[self createTime] forKey:@"createTime"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.keyName = [dictionary objectForKey:@"keyName"];
    self.keyFingerprint = [dictionary objectForKey:@"keyFingerprint"];
    self.createTime = [dictionary objectForKey:@"createTime"];
    return self;
}
 @end
@implementation Userdata
-(id) initWithKey:(NSString*) key
      value:(NSString*)value { 
     self.key = key;               
     self.value = value;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self key])
    {
        [result setValue:[self key] forKey:@"key"];
    }
    if([self value])
    {
        [result setValue:[self value] forKey:@"value"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.key = [dictionary objectForKey:@"key"];
    self.value = [dictionary objectForKey:@"value"];
    return self;
}
 @end
@implementation ImageInstanceTypeConstraint
-(id) initWithConstraintsType:(NSString*) constraintsType
      instanceTypes:(NSArray<NSString*>*)instanceTypes { 
     self.constraintsType = constraintsType;               
     self.instanceTypes = instanceTypes;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self constraintsType])
    {
        [result setValue:[self constraintsType] forKey:@"constraintsType"];
    }
    if([self instanceTypes])
    {
        [result setValue:[self instanceTypes] forKey:@"instanceTypes"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.constraintsType = [dictionary objectForKey:@"constraintsType"];
    self.instanceTypes = [dictionary objectForKey:@"instanceTypes"];
    return self;
}
 @end
@implementation UserSysDisk
-(id) initWithPin:(NSString*) pin
      region:(NSString*)region
      systemType:(NSString*)systemType
      systemDiskSize:(NSNumber*)systemDiskSize { 
     self.pin = pin;               
     self.region = region;               
     self.systemType = systemType;               
     self.systemDiskSize = systemDiskSize;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self pin])
    {
        [result setValue:[self pin] forKey:@"pin"];
    }
    if([self region])
    {
        [result setValue:[self region] forKey:@"region"];
    }
    if([self systemType])
    {
        [result setValue:[self systemType] forKey:@"systemType"];
    }
    if([self systemDiskSize])
    {
        [result setValue:[self systemDiskSize] forKey:@"systemDiskSize"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.pin = [dictionary objectForKey:@"pin"];
    self.region = [dictionary objectForKey:@"region"];
    self.systemType = [dictionary objectForKey:@"systemType"];
    self.systemDiskSize = [dictionary objectForKey:@"systemDiskSize"];
    return self;
}
 @end
@implementation InstanceStatus
-(id) initWithInstanceId:(NSString*) instanceId
      status:(NSString*)status { 
     self.instanceId = instanceId;               
     self.status = status;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self instanceId])
    {
        [result setValue:[self instanceId] forKey:@"instanceId"];
    }
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.instanceId = [dictionary objectForKey:@"instanceId"];
    self.status = [dictionary objectForKey:@"status"];
    return self;
}
 @end
@implementation CopyImage
-(id) initWithDestinationImageId:(NSString*) destinationImageId
      sourceImageId:(NSString*)sourceImageId { 
     self.destinationImageId = destinationImageId;               
     self.sourceImageId = sourceImageId;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self destinationImageId])
    {
        [result setValue:[self destinationImageId] forKey:@"destinationImageId"];
    }
    if([self sourceImageId])
    {
        [result setValue:[self sourceImageId] forKey:@"sourceImageId"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.destinationImageId = [dictionary objectForKey:@"destinationImageId"];
    self.sourceImageId = [dictionary objectForKey:@"sourceImageId"];
    return self;
}
 @end
@implementation InstanceDiskAttribute
-(id) initWithDiskId:(NSString*) diskId
      autoDelete:(NSNumber*)autoDelete { 
     self.diskId = diskId;               
     self.autoDelete = autoDelete;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self diskId])
    {
        [result setValue:[self diskId] forKey:@"diskId"];
    }
    if([self autoDelete])
    {
        [result setValue:[self autoDelete] forKey:@"autoDelete"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.diskId = [dictionary objectForKey:@"diskId"];
    self.autoDelete = [dictionary objectForKey:@"autoDelete"];
    return self;
}
 @end
@implementation InstancePrivateIpAddress
-(id) initWithInstanceId:(NSString*) instanceId
      privateIpAddress:(NSString*)privateIpAddress { 
     self.instanceId = instanceId;               
     self.privateIpAddress = privateIpAddress;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self instanceId])
    {
        [result setValue:[self instanceId] forKey:@"instanceId"];
    }
    if([self privateIpAddress])
    {
        [result setValue:[self privateIpAddress] forKey:@"privateIpAddress"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.instanceId = [dictionary objectForKey:@"instanceId"];
    self.privateIpAddress = [dictionary objectForKey:@"privateIpAddress"];
    return self;
}
 @end
@implementation InstanceNetworkAttribute
-(id) initWithNetworkInterfaceId:(NSString*) networkInterfaceId
      autoDelete:(NSNumber*)autoDelete { 
     self.networkInterfaceId = networkInterfaceId;               
     self.autoDelete = autoDelete;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self networkInterfaceId])
    {
        [result setValue:[self networkInterfaceId] forKey:@"networkInterfaceId"];
    }
    if([self autoDelete])
    {
        [result setValue:[self autoDelete] forKey:@"autoDelete"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.networkInterfaceId = [dictionary objectForKey:@"networkInterfaceId"];
    self.autoDelete = [dictionary objectForKey:@"autoDelete"];
    return self;
}
 @end
@implementation TaskInfo
-(id) initWithTaskId:(NSNumber*) taskId
      action:(NSString*)action
      taskStatus:(NSString*)taskStatus
      progress:(NSNumber*)progress
      message:(NSString*)message
      createdTime:(NSString*)createdTime
      finishedTime:(NSString*)finishedTime { 
     self.taskId = taskId;               
     self.action = action;               
     self.taskStatus = taskStatus;               
     self.progress = progress;               
     self.message = message;               
     self.createdTime = createdTime;               
     self.finishedTime = finishedTime;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self taskId])
    {
        [result setValue:[self taskId] forKey:@"taskId"];
    }
    if([self action])
    {
        [result setValue:[self action] forKey:@"action"];
    }
    if([self taskStatus])
    {
        [result setValue:[self taskStatus] forKey:@"taskStatus"];
    }
    if([self progress])
    {
        [result setValue:[self progress] forKey:@"progress"];
    }
    if([self message])
    {
        [result setValue:[self message] forKey:@"message"];
    }
    if([self createdTime])
    {
        [result setValue:[self createdTime] forKey:@"createdTime"];
    }
    if([self finishedTime])
    {
        [result setValue:[self finishedTime] forKey:@"finishedTime"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.taskId = [dictionary objectForKey:@"taskId"];
    self.action = [dictionary objectForKey:@"action"];
    self.taskStatus = [dictionary objectForKey:@"taskStatus"];
    self.progress = [dictionary objectForKey:@"progress"];
    self.message = [dictionary objectForKey:@"message"];
    self.createdTime = [dictionary objectForKey:@"createdTime"];
    self.finishedTime = [dictionary objectForKey:@"finishedTime"];
    return self;
}
 @end
@implementation InstanceNetworkInterface
-(id) initWithNetworkInterfaceId:(NSString*) networkInterfaceId
      macAddress:(NSString*)macAddress
      vpcId:(NSString*)vpcId
      subnetId:(NSString*)subnetId
      securityGroups:(NSArray<SecurityGroupSimple*>*)securityGroups
      sanityCheck:(NSNumber*)sanityCheck
      primaryIp:(NetworkInterfacePrivateIp*)primaryIp
      secondaryIps:(NSArray<NetworkInterfacePrivateIp*>*)secondaryIps { 
     self.networkInterfaceId = networkInterfaceId;               
     self.macAddress = macAddress;               
     self.vpcId = vpcId;               
     self.subnetId = subnetId;               
     self.securityGroups = securityGroups;               
     self.sanityCheck = sanityCheck;               
     self.primaryIp = primaryIp;               
     self.secondaryIps = secondaryIps;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self networkInterfaceId])
    {
        [result setValue:[self networkInterfaceId] forKey:@"networkInterfaceId"];
    }
    if([self macAddress])
    {
        [result setValue:[self macAddress] forKey:@"macAddress"];
    }
    if([self vpcId])
    {
        [result setValue:[self vpcId] forKey:@"vpcId"];
    }
    if([self subnetId])
    {
        [result setValue:[self subnetId] forKey:@"subnetId"];
    }
    if([self securityGroups])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self securityGroups] count]; i++) {
            SecurityGroupSimple* item = [[self securityGroups] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"securityGroups"];
    }
    if([self sanityCheck])
    {
        [result setValue:[self sanityCheck] forKey:@"sanityCheck"];
    }
    if([self primaryIp])
    {
        [result setValue:[[self primaryIp] dictionary]forKey:@"primaryIp"];
    }
    if([self secondaryIps])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self secondaryIps] count]; i++) {
            NetworkInterfacePrivateIp* item = [[self secondaryIps] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"secondaryIps"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.networkInterfaceId = [dictionary objectForKey:@"networkInterfaceId"];
    self.macAddress = [dictionary objectForKey:@"macAddress"];
    self.vpcId = [dictionary objectForKey:@"vpcId"];
    self.subnetId = [dictionary objectForKey:@"subnetId"];
    NSArray* securityGroupsArray = [dictionary objectForKey:@"securityGroups"];
    if(securityGroupsArray&&![securityGroupsArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [securityGroupsArray count];i++)
        {
            SecurityGroupSimple* item = [[SecurityGroupSimple alloc]initWithDic:[securityGroupsArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.securityGroups = propertyArray;
    }
    self.sanityCheck = [dictionary objectForKey:@"sanityCheck"];
    self.primaryIp = [[NetworkInterfacePrivateIp alloc]initWithDic:[dictionary objectForKey:@"primaryIp"]];
    NSArray* secondaryIpsArray = [dictionary objectForKey:@"secondaryIps"];
    if(secondaryIpsArray&&![secondaryIpsArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [secondaryIpsArray count];i++)
        {
            NetworkInterfacePrivateIp* item = [[NetworkInterfacePrivateIp alloc]initWithDic:[secondaryIpsArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.secondaryIps = propertyArray;
    }
    return self;
}
 @end
@implementation InstanceNetworkInterfaceAttachment
-(id) initWithDeviceIndex:(NSNumber*) deviceIndex
      autoDelete:(NSNumber*)autoDelete
      networkInterface:(InstanceNetworkInterface*)networkInterface { 
     self.deviceIndex = deviceIndex;               
     self.autoDelete = autoDelete;               
     self.networkInterface = networkInterface;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self deviceIndex])
    {
        [result setValue:[self deviceIndex] forKey:@"deviceIndex"];
    }
    if([self autoDelete])
    {
        [result setValue:[self autoDelete] forKey:@"autoDelete"];
    }
    if([self networkInterface])
    {
        [result setValue:[[self networkInterface] dictionary]forKey:@"networkInterface"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.deviceIndex = [dictionary objectForKey:@"deviceIndex"];
    self.autoDelete = [dictionary objectForKey:@"autoDelete"];
    self.networkInterface = [[InstanceNetworkInterface alloc]initWithDic:[dictionary objectForKey:@"networkInterface"]];
    return self;
}
 @end
@implementation InstanceTemplateDiskAttachment
-(id) initWithDiskCategory:(NSString*) diskCategory
      autoDelete:(NSNumber*)autoDelete
      instanceTemplateDisk:(InstanceTemplateDisk*)instanceTemplateDisk
      deviceName:(NSString*)deviceName
      noDevice:(NSNumber*)noDevice { 
     self.diskCategory = diskCategory;               
     self.autoDelete = autoDelete;               
     self.instanceTemplateDisk = instanceTemplateDisk;               
     self.deviceName = deviceName;               
     self.noDevice = noDevice;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self diskCategory])
    {
        [result setValue:[self diskCategory] forKey:@"diskCategory"];
    }
    if([self autoDelete])
    {
        [result setValue:[self autoDelete] forKey:@"autoDelete"];
    }
    if([self instanceTemplateDisk])
    {
        [result setValue:[[self instanceTemplateDisk] dictionary]forKey:@"instanceTemplateDisk"];
    }
    if([self deviceName])
    {
        [result setValue:[self deviceName] forKey:@"deviceName"];
    }
    if([self noDevice])
    {
        [result setValue:[self noDevice] forKey:@"noDevice"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.diskCategory = [dictionary objectForKey:@"diskCategory"];
    self.autoDelete = [dictionary objectForKey:@"autoDelete"];
    self.instanceTemplateDisk = [[InstanceTemplateDisk alloc]initWithDic:[dictionary objectForKey:@"instanceTemplateDisk"]];
    self.deviceName = [dictionary objectForKey:@"deviceName"];
    self.noDevice = [dictionary objectForKey:@"noDevice"];
    return self;
}
 @end
@implementation InstanceTemplateNetworkInterfaceAttachment
-(id) initWithDeviceIndex:(NSNumber*) deviceIndex
      autoDelete:(NSNumber*)autoDelete
      networkInterface:(InstanceTemplateNetworkInterface*)networkInterface { 
     self.deviceIndex = deviceIndex;               
     self.autoDelete = autoDelete;               
     self.networkInterface = networkInterface;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self deviceIndex])
    {
        [result setValue:[self deviceIndex] forKey:@"deviceIndex"];
    }
    if([self autoDelete])
    {
        [result setValue:[self autoDelete] forKey:@"autoDelete"];
    }
    if([self networkInterface])
    {
        [result setValue:[[self networkInterface] dictionary]forKey:@"networkInterface"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.deviceIndex = [dictionary objectForKey:@"deviceIndex"];
    self.autoDelete = [dictionary objectForKey:@"autoDelete"];
    self.networkInterface = [[InstanceTemplateNetworkInterface alloc]initWithDic:[dictionary objectForKey:@"networkInterface"]];
    return self;
}
 @end
@implementation InstanceType
-(id) initWithFamily:(NSString*) family
      instanceTypeValue:(NSString*)instanceTypeValue
      cpu:(NSNumber*)cpu
      memoryMB:(NSNumber*)memoryMB
      nicLimit:(NSNumber*)nicLimit
      desc:(NSString*)desc
      state:(NSArray<InstanceTypeState*>*)state
      gpu:(Gpu*)gpu
      localDisks:(NSArray<LocalDisk*>*)localDisks { 
     self.family = family;               
     self.instanceTypeValue = instanceTypeValue;               
     self.cpu = cpu;               
     self.memoryMB = memoryMB;               
     self.nicLimit = nicLimit;               
     self.desc = desc;               
     self.state = state;               
     self.gpu = gpu;               
     self.localDisks = localDisks;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self family])
    {
        [result setValue:[self family] forKey:@"family"];
    }
    if([self instanceTypeValue])
    {
        [result setValue:[self instanceTypeValue] forKey:@"instanceType"];
    }
    if([self cpu])
    {
        [result setValue:[self cpu] forKey:@"cpu"];
    }
    if([self memoryMB])
    {
        [result setValue:[self memoryMB] forKey:@"memoryMB"];
    }
    if([self nicLimit])
    {
        [result setValue:[self nicLimit] forKey:@"nicLimit"];
    }
    if([self desc])
    {
        [result setValue:[self desc] forKey:@"desc"];
    }
    if([self state])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self state] count]; i++) {
            InstanceTypeState* item = [[self state] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"state"];
    }
    if([self gpu])
    {
        [result setValue:[[self gpu] dictionary]forKey:@"gpu"];
    }
    if([self localDisks])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self localDisks] count]; i++) {
            LocalDisk* item = [[self localDisks] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"localDisks"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.family = [dictionary objectForKey:@"family"];
    self.instanceTypeValue = [dictionary objectForKey:@"instanceType"];
    self.cpu = [dictionary objectForKey:@"cpu"];
    self.memoryMB = [dictionary objectForKey:@"memoryMB"];
    self.nicLimit = [dictionary objectForKey:@"nicLimit"];
    self.desc = [dictionary objectForKey:@"desc"];
    NSArray* stateArray = [dictionary objectForKey:@"state"];
    if(stateArray&&![stateArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [stateArray count];i++)
        {
            InstanceTypeState* item = [[InstanceTypeState alloc]initWithDic:[stateArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.state = propertyArray;
    }
    self.gpu = [[Gpu alloc]initWithDic:[dictionary objectForKey:@"gpu"]];
    NSArray* localDisksArray = [dictionary objectForKey:@"localDisks"];
    if(localDisksArray&&![localDisksArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [localDisksArray count];i++)
        {
            LocalDisk* item = [[LocalDisk alloc]initWithDic:[localDisksArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.localDisks = propertyArray;
    }
    return self;
}
 @end
@implementation InstanceDiskAttachment
-(id) initWithDiskCategory:(NSString*) diskCategory
      autoDelete:(NSNumber*)autoDelete
      localDisk:(LocalDisk*)localDisk
      cloudDisk:(Disk*)cloudDisk
      deviceName:(NSString*)deviceName
      status:(NSString*)status { 
     self.diskCategory = diskCategory;               
     self.autoDelete = autoDelete;               
     self.localDisk = localDisk;               
     self.cloudDisk = cloudDisk;               
     self.deviceName = deviceName;               
     self.status = status;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self diskCategory])
    {
        [result setValue:[self diskCategory] forKey:@"diskCategory"];
    }
    if([self autoDelete])
    {
        [result setValue:[self autoDelete] forKey:@"autoDelete"];
    }
    if([self localDisk])
    {
        [result setValue:[[self localDisk] dictionary]forKey:@"localDisk"];
    }
    if([self cloudDisk])
    {
        [result setValue:[[self cloudDisk] dictionary]forKey:@"cloudDisk"];
    }
    if([self deviceName])
    {
        [result setValue:[self deviceName] forKey:@"deviceName"];
    }
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.diskCategory = [dictionary objectForKey:@"diskCategory"];
    self.autoDelete = [dictionary objectForKey:@"autoDelete"];
    self.localDisk = [[LocalDisk alloc]initWithDic:[dictionary objectForKey:@"localDisk"]];
    self.cloudDisk = [[Disk alloc]initWithDic:[dictionary objectForKey:@"cloudDisk"]];
    self.deviceName = [dictionary objectForKey:@"deviceName"];
    self.status = [dictionary objectForKey:@"status"];
    return self;
}
 @end
@implementation InstanceTemplateNetworkInterfaceAttachmentSpec
-(id) initWithDeviceIndex:(NSNumber*) deviceIndex
      autoDelete:(NSNumber*)autoDelete
      networkInterface:(InstanceTemplateNetworkInterfaceSpec*)networkInterface { 
     self.deviceIndex = deviceIndex;               
     self.autoDelete = autoDelete;               
     self.networkInterface = networkInterface;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self deviceIndex])
    {
        [result setValue:[self deviceIndex] forKey:@"deviceIndex"];
    }
    if([self autoDelete])
    {
        [result setValue:[self autoDelete] forKey:@"autoDelete"];
    }
    if([self networkInterface])
    {
        [result setValue:[[self networkInterface] dictionary]forKey:@"networkInterface"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.deviceIndex = [dictionary objectForKey:@"deviceIndex"];
    self.autoDelete = [dictionary objectForKey:@"autoDelete"];
    self.networkInterface = [[InstanceTemplateNetworkInterfaceSpec alloc]initWithDic:[dictionary objectForKey:@"networkInterface"]];
    return self;
}
 @end
@implementation InstanceTemplateDiskAttachmentSpec
-(id) initWithDiskCategory:(NSString*) diskCategory
      autoDelete:(NSNumber*)autoDelete
      cloudDiskSpec:(InstanceTemplateDiskSpec*)cloudDiskSpec
      deviceName:(NSString*)deviceName
      noDevice:(NSNumber*)noDevice { 
     self.diskCategory = diskCategory;               
     self.autoDelete = autoDelete;               
     self.cloudDiskSpec = cloudDiskSpec;               
     self.deviceName = deviceName;               
     self.noDevice = noDevice;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self diskCategory])
    {
        [result setValue:[self diskCategory] forKey:@"diskCategory"];
    }
    if([self autoDelete])
    {
        [result setValue:[self autoDelete] forKey:@"autoDelete"];
    }
    if([self cloudDiskSpec])
    {
        [result setValue:[[self cloudDiskSpec] dictionary]forKey:@"cloudDiskSpec"];
    }
    if([self deviceName])
    {
        [result setValue:[self deviceName] forKey:@"deviceName"];
    }
    if([self noDevice])
    {
        [result setValue:[self noDevice] forKey:@"noDevice"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.diskCategory = [dictionary objectForKey:@"diskCategory"];
    self.autoDelete = [dictionary objectForKey:@"autoDelete"];
    self.cloudDiskSpec = [[InstanceTemplateDiskSpec alloc]initWithDic:[dictionary objectForKey:@"cloudDiskSpec"]];
    self.deviceName = [dictionary objectForKey:@"deviceName"];
    self.noDevice = [dictionary objectForKey:@"noDevice"];
    return self;
}
 @end
@implementation InstanceDiskAttachmentSpec
-(id) initWithDiskCategory:(NSString*) diskCategory
      autoDelete:(NSNumber*)autoDelete
      cloudDiskSpec:(DiskSpec*)cloudDiskSpec
      deviceName:(NSString*)deviceName
      noDevice:(NSNumber*)noDevice { 
     self.diskCategory = diskCategory;               
     self.autoDelete = autoDelete;               
     self.cloudDiskSpec = cloudDiskSpec;               
     self.deviceName = deviceName;               
     self.noDevice = noDevice;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self diskCategory])
    {
        [result setValue:[self diskCategory] forKey:@"diskCategory"];
    }
    if([self autoDelete])
    {
        [result setValue:[self autoDelete] forKey:@"autoDelete"];
    }
    if([self cloudDiskSpec])
    {
        [result setValue:[[self cloudDiskSpec] dictionary]forKey:@"cloudDiskSpec"];
    }
    if([self deviceName])
    {
        [result setValue:[self deviceName] forKey:@"deviceName"];
    }
    if([self noDevice])
    {
        [result setValue:[self noDevice] forKey:@"noDevice"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.diskCategory = [dictionary objectForKey:@"diskCategory"];
    self.autoDelete = [dictionary objectForKey:@"autoDelete"];
    self.cloudDiskSpec = [[DiskSpec alloc]initWithDic:[dictionary objectForKey:@"cloudDiskSpec"]];
    self.deviceName = [dictionary objectForKey:@"deviceName"];
    self.noDevice = [dictionary objectForKey:@"noDevice"];
    return self;
}
 @end
@implementation Instance
-(id) initWithInstanceId:(NSString*) instanceId
      instanceName:(NSString*)instanceName
      instanceType:(NSString*)instanceType
      vpcId:(NSString*)vpcId
      subnetId:(NSString*)subnetId
      privateIpAddress:(NSString*)privateIpAddress
      elasticIpId:(NSString*)elasticIpId
      elasticIpAddress:(NSString*)elasticIpAddress
      status:(NSString*)status
      descriptionValue:(NSString*)descriptionValue
      imageId:(NSString*)imageId
      systemDisk:(InstanceDiskAttachment*)systemDisk
      dataDisks:(NSArray<InstanceDiskAttachment*>*)dataDisks
      primaryNetworkInterface:(InstanceNetworkInterfaceAttachment*)primaryNetworkInterface
      secondaryNetworkInterfaces:(NSArray<InstanceNetworkInterfaceAttachment*>*)secondaryNetworkInterfaces
      launchTime:(NSString*)launchTime
      az:(NSString*)az
      keyNames:(NSArray<NSString*>*)keyNames
      charge:(Charge*)charge
      ag:(Ag*)ag
      faultDomain:(NSString*)faultDomain
      tags:(NSArray<Tag*>*)tags { 
     self.instanceId = instanceId;               
     self.instanceName = instanceName;               
     self.instanceType = instanceType;               
     self.vpcId = vpcId;               
     self.subnetId = subnetId;               
     self.privateIpAddress = privateIpAddress;               
     self.elasticIpId = elasticIpId;               
     self.elasticIpAddress = elasticIpAddress;               
     self.status = status;               
     self.descriptionValue = descriptionValue;               
     self.imageId = imageId;               
     self.systemDisk = systemDisk;               
     self.dataDisks = dataDisks;               
     self.primaryNetworkInterface = primaryNetworkInterface;               
     self.secondaryNetworkInterfaces = secondaryNetworkInterfaces;               
     self.launchTime = launchTime;               
     self.az = az;               
     self.keyNames = keyNames;               
     self.charge = charge;               
     self.ag = ag;               
     self.faultDomain = faultDomain;               
     self.tags = tags;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self instanceId])
    {
        [result setValue:[self instanceId] forKey:@"instanceId"];
    }
    if([self instanceName])
    {
        [result setValue:[self instanceName] forKey:@"instanceName"];
    }
    if([self instanceType])
    {
        [result setValue:[self instanceType] forKey:@"instanceType"];
    }
    if([self vpcId])
    {
        [result setValue:[self vpcId] forKey:@"vpcId"];
    }
    if([self subnetId])
    {
        [result setValue:[self subnetId] forKey:@"subnetId"];
    }
    if([self privateIpAddress])
    {
        [result setValue:[self privateIpAddress] forKey:@"privateIpAddress"];
    }
    if([self elasticIpId])
    {
        [result setValue:[self elasticIpId] forKey:@"elasticIpId"];
    }
    if([self elasticIpAddress])
    {
        [result setValue:[self elasticIpAddress] forKey:@"elasticIpAddress"];
    }
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    if([self descriptionValue])
    {
        [result setValue:[self descriptionValue] forKey:@"description"];
    }
    if([self imageId])
    {
        [result setValue:[self imageId] forKey:@"imageId"];
    }
    if([self systemDisk])
    {
        [result setValue:[[self systemDisk] dictionary]forKey:@"systemDisk"];
    }
    if([self dataDisks])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self dataDisks] count]; i++) {
            InstanceDiskAttachment* item = [[self dataDisks] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"dataDisks"];
    }
    if([self primaryNetworkInterface])
    {
        [result setValue:[[self primaryNetworkInterface] dictionary]forKey:@"primaryNetworkInterface"];
    }
    if([self secondaryNetworkInterfaces])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self secondaryNetworkInterfaces] count]; i++) {
            InstanceNetworkInterfaceAttachment* item = [[self secondaryNetworkInterfaces] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"secondaryNetworkInterfaces"];
    }
    if([self launchTime])
    {
        [result setValue:[self launchTime] forKey:@"launchTime"];
    }
    if([self az])
    {
        [result setValue:[self az] forKey:@"az"];
    }
    if([self keyNames])
    {
        [result setValue:[self keyNames] forKey:@"keyNames"];
    }
    if([self charge])
    {
        [result setValue:[[self charge] dictionary]forKey:@"charge"];
    }
    if([self ag])
    {
        [result setValue:[[self ag] dictionary]forKey:@"ag"];
    }
    if([self faultDomain])
    {
        [result setValue:[self faultDomain] forKey:@"faultDomain"];
    }
    if([self tags])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self tags] count]; i++) {
            Tag* item = [[self tags] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"tags"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.instanceId = [dictionary objectForKey:@"instanceId"];
    self.instanceName = [dictionary objectForKey:@"instanceName"];
    self.instanceType = [dictionary objectForKey:@"instanceType"];
    self.vpcId = [dictionary objectForKey:@"vpcId"];
    self.subnetId = [dictionary objectForKey:@"subnetId"];
    self.privateIpAddress = [dictionary objectForKey:@"privateIpAddress"];
    self.elasticIpId = [dictionary objectForKey:@"elasticIpId"];
    self.elasticIpAddress = [dictionary objectForKey:@"elasticIpAddress"];
    self.status = [dictionary objectForKey:@"status"];
    self.descriptionValue = [dictionary objectForKey:@"description"];
    self.imageId = [dictionary objectForKey:@"imageId"];
    self.systemDisk = [[InstanceDiskAttachment alloc]initWithDic:[dictionary objectForKey:@"systemDisk"]];
    NSArray* dataDisksArray = [dictionary objectForKey:@"dataDisks"];
    if(dataDisksArray&&![dataDisksArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [dataDisksArray count];i++)
        {
            InstanceDiskAttachment* item = [[InstanceDiskAttachment alloc]initWithDic:[dataDisksArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.dataDisks = propertyArray;
    }
    self.primaryNetworkInterface = [[InstanceNetworkInterfaceAttachment alloc]initWithDic:[dictionary objectForKey:@"primaryNetworkInterface"]];
    NSArray* secondaryNetworkInterfacesArray = [dictionary objectForKey:@"secondaryNetworkInterfaces"];
    if(secondaryNetworkInterfacesArray&&![secondaryNetworkInterfacesArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [secondaryNetworkInterfacesArray count];i++)
        {
            InstanceNetworkInterfaceAttachment* item = [[InstanceNetworkInterfaceAttachment alloc]initWithDic:[secondaryNetworkInterfacesArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.secondaryNetworkInterfaces = propertyArray;
    }
    self.launchTime = [dictionary objectForKey:@"launchTime"];
    self.az = [dictionary objectForKey:@"az"];
    self.keyNames = [dictionary objectForKey:@"keyNames"];
    self.charge = [[Charge alloc]initWithDic:[dictionary objectForKey:@"charge"]];
    self.ag = [[Ag alloc]initWithDic:[dictionary objectForKey:@"ag"]];
    self.faultDomain = [dictionary objectForKey:@"faultDomain"];
    NSArray* tagsArray = [dictionary objectForKey:@"tags"];
    if(tagsArray&&![tagsArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [tagsArray count];i++)
        {
            Tag* item = [[Tag alloc]initWithDic:[tagsArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.tags = propertyArray;
    }
    return self;
}
 @end
@implementation ImageConstraint
-(id) initWithImageId:(NSString*) imageId
      imageInstanceTypeConstraint:(ImageInstanceTypeConstraint*)imageInstanceTypeConstraint { 
     self.imageId = imageId;               
     self.imageInstanceTypeConstraint = imageInstanceTypeConstraint;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self imageId])
    {
        [result setValue:[self imageId] forKey:@"imageId"];
    }
    if([self imageInstanceTypeConstraint])
    {
        [result setValue:[[self imageInstanceTypeConstraint] dictionary]forKey:@"imageInstanceTypeConstraint"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.imageId = [dictionary objectForKey:@"imageId"];
    self.imageInstanceTypeConstraint = [[ImageInstanceTypeConstraint alloc]initWithDic:[dictionary objectForKey:@"imageInstanceTypeConstraint"]];
    return self;
}
 @end
@implementation InstanceNetworkInterfaceAttachmentSpec
-(id) initWithDeviceIndex:(NSNumber*) deviceIndex
      networkInterface:(NetworkInterfaceSpec*)networkInterface { 
     self.deviceIndex = deviceIndex;               
     self.networkInterface = networkInterface;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self deviceIndex])
    {
        [result setValue:[self deviceIndex] forKey:@"deviceIndex"];
    }
    if([self networkInterface])
    {
        [result setValue:[[self networkInterface] dictionary]forKey:@"networkInterface"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.deviceIndex = [dictionary objectForKey:@"deviceIndex"];
    self.networkInterface = [[NetworkInterfaceSpec alloc]initWithDic:[dictionary objectForKey:@"networkInterface"]];
    return self;
}
 @end
@implementation Image
-(id) initWithImageId:(NSString*) imageId
      name:(NSString*)name
      platform:(NSString*)platform
      osVersion:(NSString*)osVersion
      architecture:(NSString*)architecture
      systemDiskSizeGB:(NSNumber*)systemDiskSizeGB
      imageSource:(NSString*)imageSource
      osType:(NSString*)osType
      status:(NSString*)status
      createTime:(NSString*)createTime
      sizeMB:(NSNumber*)sizeMB
      desc:(NSString*)desc
      ownerPin:(NSString*)ownerPin
      launchPermission:(NSString*)launchPermission
      systemDisk:(InstanceDiskAttachment*)systemDisk
      dataDisks:(NSArray<InstanceDiskAttachment*>*)dataDisks
      snapshotId:(NSString*)snapshotId
      rootDeviceType:(NSString*)rootDeviceType
      progress:(NSString*)progress { 
     self.imageId = imageId;               
     self.name = name;               
     self.platform = platform;               
     self.osVersion = osVersion;               
     self.architecture = architecture;               
     self.systemDiskSizeGB = systemDiskSizeGB;               
     self.imageSource = imageSource;               
     self.osType = osType;               
     self.status = status;               
     self.createTime = createTime;               
     self.sizeMB = sizeMB;               
     self.desc = desc;               
     self.ownerPin = ownerPin;               
     self.launchPermission = launchPermission;               
     self.systemDisk = systemDisk;               
     self.dataDisks = dataDisks;               
     self.snapshotId = snapshotId;               
     self.rootDeviceType = rootDeviceType;               
     self.progress = progress;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self imageId])
    {
        [result setValue:[self imageId] forKey:@"imageId"];
    }
    if([self name])
    {
        [result setValue:[self name] forKey:@"name"];
    }
    if([self platform])
    {
        [result setValue:[self platform] forKey:@"platform"];
    }
    if([self osVersion])
    {
        [result setValue:[self osVersion] forKey:@"osVersion"];
    }
    if([self architecture])
    {
        [result setValue:[self architecture] forKey:@"architecture"];
    }
    if([self systemDiskSizeGB])
    {
        [result setValue:[self systemDiskSizeGB] forKey:@"systemDiskSizeGB"];
    }
    if([self imageSource])
    {
        [result setValue:[self imageSource] forKey:@"imageSource"];
    }
    if([self osType])
    {
        [result setValue:[self osType] forKey:@"osType"];
    }
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    if([self createTime])
    {
        [result setValue:[self createTime] forKey:@"createTime"];
    }
    if([self sizeMB])
    {
        [result setValue:[self sizeMB] forKey:@"sizeMB"];
    }
    if([self desc])
    {
        [result setValue:[self desc] forKey:@"desc"];
    }
    if([self ownerPin])
    {
        [result setValue:[self ownerPin] forKey:@"ownerPin"];
    }
    if([self launchPermission])
    {
        [result setValue:[self launchPermission] forKey:@"launchPermission"];
    }
    if([self systemDisk])
    {
        [result setValue:[[self systemDisk] dictionary]forKey:@"systemDisk"];
    }
    if([self dataDisks])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self dataDisks] count]; i++) {
            InstanceDiskAttachment* item = [[self dataDisks] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"dataDisks"];
    }
    if([self snapshotId])
    {
        [result setValue:[self snapshotId] forKey:@"snapshotId"];
    }
    if([self rootDeviceType])
    {
        [result setValue:[self rootDeviceType] forKey:@"rootDeviceType"];
    }
    if([self progress])
    {
        [result setValue:[self progress] forKey:@"progress"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.imageId = [dictionary objectForKey:@"imageId"];
    self.name = [dictionary objectForKey:@"name"];
    self.platform = [dictionary objectForKey:@"platform"];
    self.osVersion = [dictionary objectForKey:@"osVersion"];
    self.architecture = [dictionary objectForKey:@"architecture"];
    self.systemDiskSizeGB = [dictionary objectForKey:@"systemDiskSizeGB"];
    self.imageSource = [dictionary objectForKey:@"imageSource"];
    self.osType = [dictionary objectForKey:@"osType"];
    self.status = [dictionary objectForKey:@"status"];
    self.createTime = [dictionary objectForKey:@"createTime"];
    self.sizeMB = [dictionary objectForKey:@"sizeMB"];
    self.desc = [dictionary objectForKey:@"desc"];
    self.ownerPin = [dictionary objectForKey:@"ownerPin"];
    self.launchPermission = [dictionary objectForKey:@"launchPermission"];
    self.systemDisk = [[InstanceDiskAttachment alloc]initWithDic:[dictionary objectForKey:@"systemDisk"]];
    NSArray* dataDisksArray = [dictionary objectForKey:@"dataDisks"];
    if(dataDisksArray&&![dataDisksArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [dataDisksArray count];i++)
        {
            InstanceDiskAttachment* item = [[InstanceDiskAttachment alloc]initWithDic:[dataDisksArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.dataDisks = propertyArray;
    }
    self.snapshotId = [dictionary objectForKey:@"snapshotId"];
    self.rootDeviceType = [dictionary objectForKey:@"rootDeviceType"];
    self.progress = [dictionary objectForKey:@"progress"];
    return self;
}
 @end
@implementation InstanceSpec
-(id) initWithAgId:(NSString*) agId
      instanceTemplateId:(NSString*)instanceTemplateId
      az:(NSString*)az
      instanceType:(NSString*)instanceType
      imageId:(NSString*)imageId
      name:(NSString*)name
      password:(NSString*)password
      keyNames:(NSArray<NSString*>*)keyNames
      elasticIp:(ElasticIpSpec*)elasticIp
      primaryNetworkInterface:(InstanceNetworkInterfaceAttachmentSpec*)primaryNetworkInterface
      systemDisk:(InstanceDiskAttachmentSpec*)systemDisk
      dataDisks:(NSArray<InstanceDiskAttachmentSpec*>*)dataDisks
      charge:(ChargeSpec*)charge
      userdata:(NSArray<Userdata*>*)userdata
      descriptionValue:(NSString*)descriptionValue
      noPassword:(NSNumber*)noPassword
      noKeyNames:(NSNumber*)noKeyNames
      noElasticIp:(NSNumber*)noElasticIp
      userTags:(NSArray<Tag*>*)userTags { 
     self.agId = agId;               
     self.instanceTemplateId = instanceTemplateId;               
     self.az = az;               
     self.instanceType = instanceType;               
     self.imageId = imageId;               
     self.name = name;               
     self.password = password;               
     self.keyNames = keyNames;               
     self.elasticIp = elasticIp;               
     self.primaryNetworkInterface = primaryNetworkInterface;               
     self.systemDisk = systemDisk;               
     self.dataDisks = dataDisks;               
     self.charge = charge;               
     self.userdata = userdata;               
     self.descriptionValue = descriptionValue;               
     self.noPassword = noPassword;               
     self.noKeyNames = noKeyNames;               
     self.noElasticIp = noElasticIp;               
     self.userTags = userTags;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self agId])
    {
        [result setValue:[self agId] forKey:@"agId"];
    }
    if([self instanceTemplateId])
    {
        [result setValue:[self instanceTemplateId] forKey:@"instanceTemplateId"];
    }
    if([self az])
    {
        [result setValue:[self az] forKey:@"az"];
    }
    if([self instanceType])
    {
        [result setValue:[self instanceType] forKey:@"instanceType"];
    }
    if([self imageId])
    {
        [result setValue:[self imageId] forKey:@"imageId"];
    }
    if([self name])
    {
        [result setValue:[self name] forKey:@"name"];
    }
    if([self password])
    {
        [result setValue:[self password] forKey:@"password"];
    }
    if([self keyNames])
    {
        [result setValue:[self keyNames] forKey:@"keyNames"];
    }
    if([self elasticIp])
    {
        [result setValue:[[self elasticIp] dictionary]forKey:@"elasticIp"];
    }
    if([self primaryNetworkInterface])
    {
        [result setValue:[[self primaryNetworkInterface] dictionary]forKey:@"primaryNetworkInterface"];
    }
    if([self systemDisk])
    {
        [result setValue:[[self systemDisk] dictionary]forKey:@"systemDisk"];
    }
    if([self dataDisks])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self dataDisks] count]; i++) {
            InstanceDiskAttachmentSpec* item = [[self dataDisks] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"dataDisks"];
    }
    if([self charge])
    {
        [result setValue:[[self charge] dictionary]forKey:@"charge"];
    }
    if([self userdata])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self userdata] count]; i++) {
            Userdata* item = [[self userdata] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"userdata"];
    }
    if([self descriptionValue])
    {
        [result setValue:[self descriptionValue] forKey:@"description"];
    }
    if([self noPassword])
    {
        [result setValue:[self noPassword] forKey:@"noPassword"];
    }
    if([self noKeyNames])
    {
        [result setValue:[self noKeyNames] forKey:@"noKeyNames"];
    }
    if([self noElasticIp])
    {
        [result setValue:[self noElasticIp] forKey:@"noElasticIp"];
    }
    if([self userTags])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self userTags] count]; i++) {
            Tag* item = [[self userTags] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"userTags"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.agId = [dictionary objectForKey:@"agId"];
    self.instanceTemplateId = [dictionary objectForKey:@"instanceTemplateId"];
    self.az = [dictionary objectForKey:@"az"];
    self.instanceType = [dictionary objectForKey:@"instanceType"];
    self.imageId = [dictionary objectForKey:@"imageId"];
    self.name = [dictionary objectForKey:@"name"];
    self.password = [dictionary objectForKey:@"password"];
    self.keyNames = [dictionary objectForKey:@"keyNames"];
    self.elasticIp = [[ElasticIpSpec alloc]initWithDic:[dictionary objectForKey:@"elasticIp"]];
    self.primaryNetworkInterface = [[InstanceNetworkInterfaceAttachmentSpec alloc]initWithDic:[dictionary objectForKey:@"primaryNetworkInterface"]];
    self.systemDisk = [[InstanceDiskAttachmentSpec alloc]initWithDic:[dictionary objectForKey:@"systemDisk"]];
    NSArray* dataDisksArray = [dictionary objectForKey:@"dataDisks"];
    if(dataDisksArray&&![dataDisksArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [dataDisksArray count];i++)
        {
            InstanceDiskAttachmentSpec* item = [[InstanceDiskAttachmentSpec alloc]initWithDic:[dataDisksArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.dataDisks = propertyArray;
    }
    self.charge = [[ChargeSpec alloc]initWithDic:[dictionary objectForKey:@"charge"]];
    NSArray* userdataArray = [dictionary objectForKey:@"userdata"];
    if(userdataArray&&![userdataArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [userdataArray count];i++)
        {
            Userdata* item = [[Userdata alloc]initWithDic:[userdataArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.userdata = propertyArray;
    }
    self.descriptionValue = [dictionary objectForKey:@"description"];
    self.noPassword = [dictionary objectForKey:@"noPassword"];
    self.noKeyNames = [dictionary objectForKey:@"noKeyNames"];
    self.noElasticIp = [dictionary objectForKey:@"noElasticIp"];
    NSArray* userTagsArray = [dictionary objectForKey:@"userTags"];
    if(userTagsArray&&![userTagsArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [userTagsArray count];i++)
        {
            Tag* item = [[Tag alloc]initWithDic:[userTagsArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.userTags = propertyArray;
    }
    return self;
}
 @end
@implementation InstanceTemplateData
-(id) initWithInstanceType:(NSString*) instanceType
      vpcId:(NSString*)vpcId
      imageId:(NSString*)imageId
      includePassword:(NSNumber*)includePassword
      systemDisk:(InstanceTemplateDiskAttachment*)systemDisk
      dataDisks:(NSArray<InstanceTemplateDiskAttachment*>*)dataDisks
      primaryNetworkInterface:(InstanceTemplateNetworkInterfaceAttachment*)primaryNetworkInterface
      elasticIp:(InstanceTemplateElasticIp*)elasticIp
      keyNames:(NSArray<NSString*>*)keyNames { 
     self.instanceType = instanceType;               
     self.vpcId = vpcId;               
     self.imageId = imageId;               
     self.includePassword = includePassword;               
     self.systemDisk = systemDisk;               
     self.dataDisks = dataDisks;               
     self.primaryNetworkInterface = primaryNetworkInterface;               
     self.elasticIp = elasticIp;               
     self.keyNames = keyNames;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self instanceType])
    {
        [result setValue:[self instanceType] forKey:@"instanceType"];
    }
    if([self vpcId])
    {
        [result setValue:[self vpcId] forKey:@"vpcId"];
    }
    if([self imageId])
    {
        [result setValue:[self imageId] forKey:@"imageId"];
    }
    if([self includePassword])
    {
        [result setValue:[self includePassword] forKey:@"includePassword"];
    }
    if([self systemDisk])
    {
        [result setValue:[[self systemDisk] dictionary]forKey:@"systemDisk"];
    }
    if([self dataDisks])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self dataDisks] count]; i++) {
            InstanceTemplateDiskAttachment* item = [[self dataDisks] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"dataDisks"];
    }
    if([self primaryNetworkInterface])
    {
        [result setValue:[[self primaryNetworkInterface] dictionary]forKey:@"primaryNetworkInterface"];
    }
    if([self elasticIp])
    {
        [result setValue:[[self elasticIp] dictionary]forKey:@"elasticIp"];
    }
    if([self keyNames])
    {
        [result setValue:[self keyNames] forKey:@"keyNames"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.instanceType = [dictionary objectForKey:@"instanceType"];
    self.vpcId = [dictionary objectForKey:@"vpcId"];
    self.imageId = [dictionary objectForKey:@"imageId"];
    self.includePassword = [dictionary objectForKey:@"includePassword"];
    self.systemDisk = [[InstanceTemplateDiskAttachment alloc]initWithDic:[dictionary objectForKey:@"systemDisk"]];
    NSArray* dataDisksArray = [dictionary objectForKey:@"dataDisks"];
    if(dataDisksArray&&![dataDisksArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [dataDisksArray count];i++)
        {
            InstanceTemplateDiskAttachment* item = [[InstanceTemplateDiskAttachment alloc]initWithDic:[dataDisksArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.dataDisks = propertyArray;
    }
    self.primaryNetworkInterface = [[InstanceTemplateNetworkInterfaceAttachment alloc]initWithDic:[dictionary objectForKey:@"primaryNetworkInterface"]];
    self.elasticIp = [[InstanceTemplateElasticIp alloc]initWithDic:[dictionary objectForKey:@"elasticIp"]];
    self.keyNames = [dictionary objectForKey:@"keyNames"];
    return self;
}
 @end
@implementation InstanceTemplate
-(id) initWithId:(NSString*) idValue
      name:(NSString*)name
      descriptionValue:(NSString*)descriptionValue
      instanceTemplateData:(InstanceTemplateData*)instanceTemplateData
      ags:(NSArray<Ag*>*)ags
      createdTime:(NSString*)createdTime { 
     self.idValue = idValue;               
     self.name = name;               
     self.descriptionValue = descriptionValue;               
     self.instanceTemplateData = instanceTemplateData;               
     self.ags = ags;               
     self.createdTime = createdTime;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self idValue])
    {
        [result setValue:[self idValue] forKey:@"id"];
    }
    if([self name])
    {
        [result setValue:[self name] forKey:@"name"];
    }
    if([self descriptionValue])
    {
        [result setValue:[self descriptionValue] forKey:@"description"];
    }
    if([self instanceTemplateData])
    {
        [result setValue:[[self instanceTemplateData] dictionary]forKey:@"instanceTemplateData"];
    }
    if([self ags])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self ags] count]; i++) {
            Ag* item = [[self ags] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"ags"];
    }
    if([self createdTime])
    {
        [result setValue:[self createdTime] forKey:@"createdTime"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.idValue = [dictionary objectForKey:@"id"];
    self.name = [dictionary objectForKey:@"name"];
    self.descriptionValue = [dictionary objectForKey:@"description"];
    self.instanceTemplateData = [[InstanceTemplateData alloc]initWithDic:[dictionary objectForKey:@"instanceTemplateData"]];
    NSArray* agsArray = [dictionary objectForKey:@"ags"];
    if(agsArray&&![agsArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [agsArray count];i++)
        {
            Ag* item = [[Ag alloc]initWithDic:[agsArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.ags = propertyArray;
    }
    self.createdTime = [dictionary objectForKey:@"createdTime"];
    return self;
}
 @end
@implementation InstanceTemplateSpec
-(id) initWithInstanceType:(NSString*) instanceType
      imageId:(NSString*)imageId
      password:(NSString*)password
      keyNames:(NSArray<NSString*>*)keyNames
      elasticIp:(InstanceTemplateElasticIpSpec*)elasticIp
      primaryNetworkInterface:(InstanceTemplateNetworkInterfaceAttachmentSpec*)primaryNetworkInterface
      systemDisk:(InstanceTemplateDiskAttachmentSpec*)systemDisk
      dataDisks:(NSArray<InstanceTemplateDiskAttachmentSpec*>*)dataDisks { 
     self.instanceType = instanceType;               
     self.imageId = imageId;               
     self.password = password;               
     self.keyNames = keyNames;               
     self.elasticIp = elasticIp;               
     self.primaryNetworkInterface = primaryNetworkInterface;               
     self.systemDisk = systemDisk;               
     self.dataDisks = dataDisks;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self instanceType])
    {
        [result setValue:[self instanceType] forKey:@"instanceType"];
    }
    if([self imageId])
    {
        [result setValue:[self imageId] forKey:@"imageId"];
    }
    if([self password])
    {
        [result setValue:[self password] forKey:@"password"];
    }
    if([self keyNames])
    {
        [result setValue:[self keyNames] forKey:@"keyNames"];
    }
    if([self elasticIp])
    {
        [result setValue:[[self elasticIp] dictionary]forKey:@"elasticIp"];
    }
    if([self primaryNetworkInterface])
    {
        [result setValue:[[self primaryNetworkInterface] dictionary]forKey:@"primaryNetworkInterface"];
    }
    if([self systemDisk])
    {
        [result setValue:[[self systemDisk] dictionary]forKey:@"systemDisk"];
    }
    if([self dataDisks])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self dataDisks] count]; i++) {
            InstanceTemplateDiskAttachmentSpec* item = [[self dataDisks] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"dataDisks"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.instanceType = [dictionary objectForKey:@"instanceType"];
    self.imageId = [dictionary objectForKey:@"imageId"];
    self.password = [dictionary objectForKey:@"password"];
    self.keyNames = [dictionary objectForKey:@"keyNames"];
    self.elasticIp = [[InstanceTemplateElasticIpSpec alloc]initWithDic:[dictionary objectForKey:@"elasticIp"]];
    self.primaryNetworkInterface = [[InstanceTemplateNetworkInterfaceAttachmentSpec alloc]initWithDic:[dictionary objectForKey:@"primaryNetworkInterface"]];
    self.systemDisk = [[InstanceTemplateDiskAttachmentSpec alloc]initWithDic:[dictionary objectForKey:@"systemDisk"]];
    NSArray* dataDisksArray = [dictionary objectForKey:@"dataDisks"];
    if(dataDisksArray&&![dataDisksArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [dataDisksArray count];i++)
        {
            InstanceTemplateDiskAttachmentSpec* item = [[InstanceTemplateDiskAttachmentSpec alloc]initWithDic:[dataDisksArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.dataDisks = propertyArray;
    }
    return self;
}
 @end
 
 


